import request from '@/request/request'
//上传图片
export function uploadImg(data){
	return request({
	  url:`/common/upload`,
		method: 'post',
	  data:data,
	  upload:true
	})
}

//获取字典数据
export function getDictionary(dictName) {
  return request({
    url: `/system/dict/data/type/${dictName}`,
    method: 'get',
		loading:false
  })
}

//获取富文本数据
export function getRichText(configName) {
  return request({
    url: `/business/rich_text_config/${configName}`,
    method: 'get',
		loading:true
  })
}

//获取平台配置
export function getPlatformConfig(data) {
	return request({
		url: `/system/config/list`,
		method: 'get',
		data: data,
	})
}

//获取公告列列表
export function getNoticeList(data) {
	return request({
		url: `/system/read/listByUser`,
		method: 'get',
		data: data,
	})
}
//设置公告 已读
export function noticeMemo(data) {
	return request({
		url: `/system/read/read`,
		method: 'post',
		data: data,
	})
}

//首页统计
export function getIndexCount(data) {
	return request({
		url: `/business/driver_app/homeMessage`,
		method: 'get',
		data: data,
	})
}
// 消息列表 recipientId 传id
export function messageList(data) {
    return request({
        url: '/business/message/list',
        method: 'get',
        data:data
    })
}
// 消息详情 /business/message/{id}
export function messageDetails(id) {
    return request({
        url: `/business/message/${id}`,
        method: 'get',
    })
}
// 消息是否已读  memo 1已读  0未读
export function messageMemo(data) {
    return request({
        url: `/business/message`,
        method: 'put',
		data:data
    })
}


